package com.android.aishangauction.adapt;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.android.aishangauction.fragment.BaseLazyFragment;

import java.util.List;

/**
 * Created by lnest-php on 2017/9/14.
 */

public class BaseFragmentAdapter extends FragmentPagerAdapter {
    private FragmentManager fragmetnmanager;  //创建FragmentManager
    private List<BaseLazyFragment> listfragment; //创建一个List<Fragment>
    public BaseFragmentAdapter(FragmentManager fm,List<BaseLazyFragment> list) {
        super(fm);
        this.fragmetnmanager=fm;
        this.listfragment=list;
    }

    @Override
    public Fragment getItem(int arg0) {
        return listfragment.get(arg0); //返回第几个fragment
    }

    @Override
    public int getCount() {
        return listfragment.size(); //总共有多少个fragment
    }
}
